package parser

import (
	"gitee.com/zfd81/dbrs/sql/nodes"
	"vitess.io/vitess/go/vt/sqlparser"
)

func convertExplainTab(s *sqlparser.ExplainTab, query string) (Statement, error) {
	stmt := &DescStatement{
		tbl: s.Table.Name.String(),
	}
	stmt.sql = query
	stmt.node = nodes.NewDescTable()
	return stmt, nil
}

type DescStatement struct {
	BaseStatement
	tbl string
}

func (s DescStatement) Tbl() string {
	return s.tbl
}
